<%@ page contentType="text/html;charset=UTF-8" language="java" isELIgnored="false" %>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>ListAll</title>
</head>
<body>
<center><h1>账户信息表</h1></center>
<table border="1" align="center" width="900px">
    <tr>
        <td colspan="4" align="center">
            <form method="post" action="${pageContext.request.contextPath}/account/findByName">
                输入账户名：<input type="text" name="name">
                <input type="submit" value="搜索">
            </form>
        </td>

        <td align="center"><a href="${pageContext.request.contextPath}/addAccount.jsp">添加账户</a></td>

    </tr>
    <tr>
        <td>编号</td>
        <td>id</td>
        <td>name</td>
        <td>money</td>
        <td>操作</td>
    </tr>
    <c:forEach items="${pageInfo.list}" var="a" varStatus="vs">
        <tr>
            <td>${vs.count}</td>
            <td>${a.id}</td>
            <td>${a.name}</td>
            <td>${a.money}</td>
            <td><a href="${pageContext.request.contextPath}/account/delete?id=${a.id}">删除</a> &nbsp;&nbsp;
                <a href="${pageContext.request.contextPath}/account/findById?id=${a.id}">修改</a>
                <a href="${pageContext.request.contextPath}/account/findOrdersByaid?id=${a.id}">查询订单</a>
                <a href="${pageContext.request.contextPath}/account/findCardsByaid?id=${a.id}">查询卡号</a></td>
        </tr>
    </c:forEach>

    <tr>
        <td align="center" colspan="5">共${pageInfo.total}条数据，当前${pageInfo.pageNum}/${pageInfo.pages}页&nbsp;
            <a href="${pageContext.request.contextPath}/account/list?page=1&size=5">首页</a>
            <a href="${pageContext.request.contextPath}/account/list?page=${pageInfo.pageNum-1}&size=5">上一页</a>
            <a href="${pageContext.request.contextPath}/account/list?page=${pageInfo.pageNum+1}&size=5">下一页</a>
            <a href="${pageContext.request.contextPath}/account/list?page=${pageInfo.pages}&size=5">尾页</a>
        </td>
    </tr>
</table>
</body>
</html>
